]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
quickSettings: Ensure toggle buttons are aligned with the pixel grid
authorSebastian Keller <skeller@gnome.org>
Sun, 11 Dec 2022 17:28:26 +0000 (18:28 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 12 Dec 2022 17:14:08 +0000 (17:14 +0000)
If the width of the menu was not a multiple of the number of columns,
the toggle buttons after the first column would not be aligned with the
pixel grid. This was causing text rendering issues and slightly blurry
icons.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6210
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2577>

js/ui/quickSettings.js

index e3bbe21c0cb029b0e15e797e32058507571546dc..f35a15c3d143756fdcf120e373e441976de1b78c 100644 (file)
@@ -543,7 +543,7 @@ const QuickSettingsLayout = GObject.registerClass({
             : [0, 0];
 
         const availWidth = box.get_width() - (this.nColumns - 1) * this.column_spacing;
-        const childWidth = availWidth / this.nColumns;
+        const childWidth = Math.floor(availWidth / this.nColumns);
 
         this._overlay?.allocate_available_size(0, 0, box.get_width(), box.get_height());